import request from '@u/request'
import { HttpMethod } from '@u/http'

// 查询岗位列表
export function listPost (query) {
  return request({
    url: `/sys/post/list`,
    method: HttpMethod.GET,
    params: query
  })
}

// 查询岗位详细
export function getPost (postId) {
  return request({
    url: '/sys/post/' + postId,
    method: HttpMethod.GET
  })
}

// 新增岗位
export function addPost (data) {
  return request({
    url: '/sys/post',
    method: HttpMethod.POST,
    data: data
  })
}

// 修改岗位
export function updatePost (data) {
  return request({
    url: '/sys/post',
    method: HttpMethod.PUT,
    data: data
  })
}

// 删除岗位
export function delPost (postId) {
  return request({
    url: '/sys/post/' + postId,
    method: HttpMethod.DELETE
  })
}
